package com.silverhaze.diamond.client.ui.panel;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Properties;

/**
 * Author: Ivan Babanin
 * пїЅ Lizard Software, 2007 y.
 */
public class AboutPanel extends ImagePanel {
    public AboutPanel(ImageIcon imageIcon, final JDialog jDlg) {
        super(imageIcon);

        addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                jDlg.setVisible(false);
            }
        });
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);

        Graphics2D g2d = (Graphics2D) g;

        Properties properties = System.getProperties();
        g2d.drawString("Java Runtime v. " + properties.getProperty("java.vm.version"), 20, 300);
        g2d.drawString("Vendor: " + properties.getProperty("java.vm.vendor"), 20, 320);
        g2d.drawString(properties.getProperty("java.runtime.name"), 7, 340);
        g2d.drawString(properties.getProperty("java.vm.name"), 25, 360);
    }
}

